﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;

namespace Spammer
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        public int code;
        public string code2;
        private void button1_Click(object sender, EventArgs e)
        {
            if (radioButton1.Checked == true)
            {
                timer1.Enabled = true;
                radioButton1.Enabled = false;
                radioButton2.Enabled = false;
                radioButton3.Enabled = false;
                button1.Enabled = false;
                textBox1.Enabled = false;
                button2.Enabled = true;
            }
            if (radioButton2.Checked == true)
            {
               
                
                
                if (textBox1.Text == String.Empty)
                {
                    MessageBox.Show("Du musst was in die Textbox Schreiben.");
                }
                else
                {
                    timer2.Enabled = true;
                    radioButton1.Enabled = false;
                    radioButton2.Enabled = false;
                    radioButton3.Enabled = false;
                    button1.Enabled = false;
                    textBox1.Enabled = false;
                    button2.Enabled = true;
                }
                

                
            }
            if (radioButton3.Checked == true)
            {
                timer3.Enabled = true;
                timer2.Enabled = false;
                timer1.Enabled = false;
                radioButton1.Enabled = false;
                radioButton2.Enabled = false;
                radioButton3.Enabled = false;
                button1.Enabled = false;
                textBox1.Enabled = false;
                button2.Enabled = true;
            }
            if (radioButton4.Checked == true)
            {
                timer4.Enabled = true;
                timer3.Enabled = false;
                timer2.Enabled = false;
                timer1.Enabled = false;
                radioButton1.Enabled = false;
                radioButton2.Enabled = false;
                radioButton3.Enabled = false;
                button1.Enabled = false;
                textBox1.Enabled = false;
                button2.Enabled = true;
            }
            if (radioButton1.Checked == false && radioButton2.Checked == false && radioButton3.Checked == false && radioButton4.Checked == false)
            {
                MessageBox.Show("Error bitte wähle eine Spam Engine oben aus.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
            }



          


        }

        private void button2_Click(object sender, EventArgs e)
        {
            if (textBox1.Visible == true)
            {
                textBox1.Visible = false;
                spboxlabel.Visible = false;
            }

            if (radioButton1.Checked == true)
            {
                timer1.Enabled = false;
                radioButton1.Enabled = true;
                radioButton2.Enabled = true;
                radioButton3.Enabled = true;
                button1.Enabled = true;
                textBox1.Enabled = true;
            }
            if (radioButton2.Checked == true)
            {
                timer2.Enabled = false;
                radioButton1.Enabled = true;
                radioButton2.Enabled = true;
                radioButton3.Enabled = true;
                button1.Enabled = true;
                textBox1.Enabled = true;
            }
            if (radioButton3.Checked == true)
            {
                timer3.Enabled = false;
                radioButton1.Enabled = true;
                radioButton2.Enabled = true;
                radioButton3.Enabled = true;
                button1.Enabled = true;
                textBox1.Enabled = true;
            }
            if (radioButton4.Checked == true)
            {
                timer4.Enabled = false;
                radioButton1.Enabled = true;
                radioButton2.Enabled = true;
                radioButton3.Enabled = true;
                button1.Enabled = true;
                textBox1.Enabled = true;
            }
            button2.Enabled = false;
            textBox1.ResetText();
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            string rStr = Path.GetRandomFileName();
            rStr = rStr.Replace("0", "1"); // For Removing the .
            SendKeys.Send(rStr);
            SendKeys.Send("{Enter}");
            label1.Text = label1.Text + 1;

     
          
        }

     

        private void timer2_Tick(object sender, EventArgs e)
        {
            SendKeys.Send(textBox1.Text);
            SendKeys.Send("{Enter}");
            label1.Text = label1.Text + 1;
           
        }

        private void timer3_Tick(object sender, EventArgs e)
        {
            string uhr;
           uhr =  string.Format("Wir haben " + "{0:00}:{1:00}:{2:00}", DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second, DateTime.Now.Millisecond + " Uhr.");
            SendKeys.Send(uhr);
            SendKeys.Send("{Enter}");
        }

        private void timer4_Tick(object sender, EventArgs e)
        {
            string bla;
            StreamReader read = new StreamReader("text.txt");
            bla = read.ReadLine();
           
            read.Close();

            SendKeys.Send(bla);
            SendKeys.Send("{Space}");
        }

        private void button3_Click(object sender, EventArgs e)
        {
          
           
        }

        private void radioButton2_CheckedChanged(object sender, EventArgs e)
        {
            textBox1.Visible = true;
            spboxlabel.Visible = true;
        }

        private void radioButton1_CheckedChanged(object sender, EventArgs e)
        {
            
        }

        private void Form1_Load(object sender, EventArgs e)
        {
           
        }

        private void radioButton5_CheckedChanged(object sender, EventArgs e)
        {
            new Simple_CountDown.Countdown().ShowDialog();
            this.ShowInTaskbar = false;
        }
    }
}
